---
title: Delete case note
summary: Removes a case note, subject to role-based and note-origin (system-created, bill-note) restrictions.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-011
trigger: clsCaseNotesManager.DeleteNote() invoked
---

# Delete case note

This operation removes a case note when the caller has the required role and the note is not system-created, otherwise it blocks the deletion with a user-facing error.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-011 |
| **Trigger** | `clsCaseNotesManager.DeleteNote()` invoked |
| **Inputs** | Note ID, caller role/security keys |
| **Outputs** | Note removed, or blocked with an error message |
| **Primary components** | `clsCaseNotesManager.DeleteNote` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsCaseNotesManager.vb` |

## Steps

1. `DeleteNote()` is invoked for a target note.
2. Evaluate the caller's role/security keys and the note's origin:
   - Notes created by `"SYSTEM"` can never be deleted ([BR-LGL-013](../business-rules.md#br-lgl-013-case-note-deletion-is-restricted-by-role-and-note-origin)).
   - A bill note (`DOCCO`) may be deleted by any authorized bill-note updater ([BR-LGL-013](../business-rules.md#br-lgl-013-case-note-deletion-is-restricted-by-role-and-note-origin), [BR-LGL-014](../business-rules.md#br-lgl-014-case-note-view-update-access-is-restricted-by-security-key)).
   - Any other note may be deleted only by users in the case-update/admin group ([BR-LGL-013](../business-rules.md#br-lgl-013-case-note-deletion-is-restricted-by-role-and-note-origin), [BR-LGL-014](../business-rules.md#br-lgl-014-case-note-view-update-access-is-restricted-by-security-key)).
3. If the caller lacks the required role, or the note is system-created:
   - On failure: block the deletion and return an error message to the caller.
4. Otherwise: delete the note.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([DeleteNote invoked]) --> System{Note created by SYSTEM?}
	System -->|Yes| Blocked([Blocked: cannot delete])
	System -->|No| Bill{Bill note DOCCO?}
	Bill -->|Yes| BillAuth{Authorized bill-note updater?}
	Bill -->|No| AdminAuth{In case-update/admin group?}
	BillAuth -->|Yes| Delete[Delete note]
	BillAuth -->|No| Blocked
	AdminAuth -->|Yes| Delete
	AdminAuth -->|No| Blocked
	Delete --> EndOk([Done])
```

## Failure and edge-case behavior

- System-created notes: deletion is always blocked, regardless of caller role.
- Insufficient role for a non-bill note: deletion blocked with an error message.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsCaseNotesManager.vb`
